/**
 * Created by no1 on 2014/9/27.
 */

module.exports = {
    /*
     * server configure
     */

//  bindingApiHost: 'api.yueniapp.com',
//  apiPort: 1888,

//  bindingWebHost: '', //api.yueniapp.com
//  webPort: 7001,
//
//  bindingManApiHost: 'api.yueniapp.com',
//  manapiPort: 7002,

    // debug mode
    // if in debug mode, some middleware like limit wont load
    // logger module will print to stdout
    debug: false,

    // 字词过滤服务器配置
    wordFilter: {
        unix_socket: '/tmp/wordFilter.sock'
    },

    /**
     * elastic search config
     */
    "elasticSearch": {
        "host": (process.env.CS_ES || 'localhost')+':9200',
        //"host": "127.0.0.1:9200",
        "index": "o2o"
    },

    /**
     * mysql config
     */

    mysqlServers: [
        {
            //socketPath: '/tmp/mysql.sock',
            host: (process.env.CS_MYSQL || 'localhost'),
            //host: '127.0.0.1',
            //port: 3306,
            user: 'mahoo',
            password: 'j3YcA9eEu0LqF'
        }
    ],
    mysqlDatabase: 'mahoo',
    mysqlMaxConnections: 50,
    mysqlQueryTimeout: 5000,


    // redis config
    // use for koa-limit module as storage
    redis: {
        //unix_socket: '/tmp/redis.sock',
        host: (process.env.CS_REDIS || 'localhost'),
        port: 6379,
        options: {
            auth_pass: 'kje3lk_olkJNlkjf283u081234ndDLNdKvnZP-ODdjZZDadewqw2123'
        }
    },

    upyun: { //_prod 又拍云存储 生产环境
        activity_img_url: 'http://img.yueniapp.com/img/activity/',//活动宣传图片url
        avatar_url: 'http://img.yueniapp.com/avatar',//自定义头像url
        default_avatar_url: 'http://img.yueniapp.com/avatar/default',//默认头像url
        tag_url: 'http://img.yueniapp.com/tag',//自定义标签url
        default_tag_url: 'http://img.yueniapp.com/tag/default',//默认标签url
        img_url: 'http://img.yueniapp.com/img',//帖子图url
        video_url: 'http://img.yueniapp.com/video',//视频url
        video_play_suffix: '!videoplay',//视频开始截图后缀
        video_screenshot_suffix: '!screenshot',//视频屏幕截图后缀
        bucket: 'inmm-img',
        api_secret: '6h4Z5LoH0JbgNNDVdeDP4ejvbqc=',
        upload_url: 'http://v0.api.upyun.com',
        tag_suffix_middle: '.jpg!jpg150',//滤镜
        tag_suffix_min: '.jpg!jpg75',//标签小图
        suffix: '!jpg600',//帖子图
        suffix_min: '!jpg75',//帖子小图
        avatar_suffix: '.jpg!jpg300x300',//用户头像图
        avatar_suffix_default: '.jpg!jpg75',//用户头像图
        slider_url: 'http://img.yueniapp.com/slider',//轮播图目录
        tagmark_url: 'http://img.yueniapp.com/tagmark',//标签贴图目录
        tagbanner_url: 'http://img.yueniapp.com/tagbanner',//标签通栏图目录
        splashscreen_url: 'http://img.yueniapp.com/splashscreen',//启动画面图片url
        h5pic_url: 'http://img.yueniapp.com/h5/h',//h5图片url
        purge_url: 'http://purge.upyun.com/purge/',//刷新又拍云图片调用地址
        user: 'inmm01',
        pass: 'dkj34hFgAa9',
        token: '01ad63ee1239ebb3e47e5024d63166d5' //用户密码的md5
    },

    // 高德参数配置
    amap: {
        api_ver: 3,
        api_key: '891276fb426e6b189d23c1376f05feca',
        poi_info_url: 'http://restapi.amap.com/v3/place/detail',
        poi_info_s: 'rsv3',
        referer: 'http://admin.yueniapp.com/',
        poi_rest_convert_url: 'http://restapi.amap.com/v3/assistant/coordinate/convert',
        api_rest_key: 'c08b88a4d14140ee1ad21af757cf800b'
    },

    //h5 地址
    h5config: {
        hurl: 'http://www.yueniapp.com/h5/h-'
    },

    // mongodb 设置
    mongo: {
        uri: 'mongodb://'+(process.env.CS_MONGO || 'localhost')+':27017/yueniapp',
        //uri: 'mongodb://localhost:27017/yueniapp',
        options: {
            db: {native_parser: true},
            auto_reconnect: 1,
            server: {poolSize: 4},
            user: 'yueniapp',
            pass: 'kjhDh38273erdfEd'
        }
    },

    // 瀑布.im 机器人配置
    pubuIM: {
        url: 'https://hooks.pubu.im/services/7868kzdlgr2mcrd',
        displayUser: {
            name: "生产环境",
            avatarUrl: 'https://beta.pubu.im/img/services/custom.png'
        }
    }

};